package minimips.isa.itype;

import minimips.computer.Computer;

public class DaddiuInstruction extends RegisterWritingITypeInstruction {

	public DaddiuInstruction(long memoryAddress, int rs,
			int rt, int immediate) {
		super(memoryAddress, 25, "DADDIU", rs, rt, immediate);
	}

	@Override
	protected int getDestinationRegister() {
		return this.getOpcode() >> 16 & 31;
	}

	@Override
	protected long executeAluOperation(Computer computer) {
		long sum = computer.getId_ex_a().getRegisterValue() + computer.getId_ex_imm().getRegisterValue();
		return sum;
	}
}
